﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>集团资讯</title>
<link rel="stylesheet" href="${path }/resource/meidu/css/header.css"/>
<link rel="stylesheet" href="${path }/resource/meidu/css/footer.css"/>
<link rel="stylesheet" href="${path }/resource/meidu/css/base.css"/>
<link rel="stylesheet" href="${path }/resource/meidu/css/main.css"/>
<script type="text/javascript" src="${path }/resource/meidu/js/jquery.min.js"></script>
<script type="text/javascript" src="${path }/resource/meidu/js/common.js"></script>
<script type="text/javascript" src="${path }/resource/js/systools/AjaxProxy.js"></script>
<script type="text/javascript" src="${path }/resource/plugin/hui/lib/layer/layer.js"></script>
<style>
body{
	width:100%;
	height:100%;
	background:url(${path }/resource/meidu/images/bg.png) repeat;
	min-width:1240px;
}

</style>
</head>

<body>
<!-- 头部 -->
   <jsp:include page="_nav.jsp"></jsp:include>
<section class="content">
	<!--wrap-news/S-->
	<div class="wrap-news mt20">
    	<div class="wrap" style="width:95%;margin:20px auto;">
        	<div class="fl wid20 font12">
            	<div class="sidebar bg_white">
                	<ul id="times" >
                    	<li onclick="changeTime(2016)" >><a href="javascript:void(0);" class="active">全部</a></li>
                        <li onclick="changeTime(2016)" >><a href="javascript:void(0);">2016</a></li>
                        <li onclick="changeTime(2015)" >><a href="javascript:void(0);">2015</a></li>
                        <li onclick="changeTime(2014)" >><a href="javascript:void(0);">2014</a></li>
                        <li onclick="changeTime(2013)" >><a href="javascript:void(0);">2013</a></li>
                        <li onclick="changeTime(2012)" >><a href="javascript:void(0);">2012</a></li>
                        <li onclick="changeTime(2011)" >><a href="javascript:void(0);">2011</a></li>
                    </ul>
                </div>	
            </div>
            <div id="content" class="fr side-cont wid80 bg_white">
            	
            	<c:forEach var="item" items="${arts }">
						<div class="news-item fl">
							<a href="javascript:void(0);" class="n-list-img"> <img
								src="${item.showImg1 }" />
							</a>
							<div class="mt5 pine-green">
								<p class="font12">
									<fmt:formatDate value="${item.time }"
										pattern="yyyy-MM-dd HH:MM"></fmt:formatDate>
									<label class="n-tips">NEW</label>
								</p>
								<p class="font14">${item.name }</p>
							</div>
							<div class="mt15 mb20 font12 deep-gray">${item.description}</div>
							<a href="javascript:void(0);" class="more font12"
								style="margin-left: 0px; color: #34c8c4;">阅读更多<img
								src="${path }/resource/meidu/images/more_green.png" /></a>
						</div>
					</c:forEach>
            	
            	
             
            
            </div>
            <div class="load-item fr wid80 mt20">
                    <a onclick="loaddata()" href="javascript:void(0);" class="loadbtn block ac">载入更多</a>
                </div>
            <div class="clear"></div>  	
        </div>   
       
    </div>
    <!--wrap-news/E-->
</section>
<!-- 底部 -->
 <jsp:include page="_foot.jsp"></jsp:include>
 <script type="text/javascript">
 function getRootPath() {
		var curWwwPath = window.document.location.href;
		var pathName = window.document.location.pathname;
		return curWwwPath.substring(0, curWwwPath.indexOf(pathName));
	}
	/** 全局路径，代表当前网站的根URL */
	var basePath = getRootPath()+"/maihong";
 var pageNow=0;
 var time=2016;
 	function loaddata(){
 		$.AjaxProxy({p:{"pageNow":pageNow,"time":time}}).invoke("md/morenews",function(loj){
 			var html="";
 			for(var i=0 ; i<loj.getRowCount(); i++){
 				html+=
 					'<div class="news-item fl"><a href="javascript:void(0);" class="n-list-img"> <img src="'+loj.getString(i,"showImg1")+'" /> </a>'
					+'<div class="mt5 pine-green"> <p class="font12">'+loj.getDate(i,"time")+'<label class="n-tips">NEW</label></p>'
					+'<p class="font14">'+loj.getString(i,"name")+'</p></div>'
					+'<div class="mt15 mb20 font12 deep-gray">'+loj.getString(i,"description")+'</div><a href="javascript:void(0);" class="more font12"style="margin-left: 0px; color: #34c8c4;">阅读更多<img		src="${path }/resource/meidu/images/more_green.png" /></a></div>'
 			}
 			$("#content").append(html);
 		});
 		pageNow++;
 		setAction();
 	}
 	/**
 		改变查询时间
 	*/
 	function changeTime(_time){
 		pageNow=0;
 		time=_time;
 		$.AjaxProxy({p:{"pageNow":pageNow,"time":time}}).invoke("md/morenews",function(loj){
 			var html="";
 			for(var i=0 ; i<loj.getRowCount(); i++){
 				html+=
 					'<div class="news-item fl"><a href="javascript:void(0);" class="n-list-img"> <img src="'+loj.getString(i,"showImg1")+'" /> </a>'
					+'<div class="mt5 pine-green"> <p class="font12">'+loj.getDate(i,"time")+'<label class="n-tips">NEW</label></p>'
					+'<p class="font14">'+loj.getString(i,"name")+'</p></div>'
					+'<div class="mt15 mb20 font12 deep-gray">'+loj.getString(i,"description")+'</div><a href="javascript:void(0);" class="more font12"style="margin-left: 0px; color: #34c8c4;">阅读更多<img		src="${path }/resource/meidu/images/more_green.png" /></a></div>'
 			}
 			$("#content").html(html);
 		});
 		pageNow++;
 		setAction();
 	}
 	
 	function setAction(){
 		$("#times").find("a").each(function(){
 			var a =$(this);
 			if(a.html()==time+""){
 				$(this).attr("class"," active")
 			}else{
 				$(this).attr("class"," ")
	 		}
 		});
 	}
 
 </script>
</body>
</html>
